package leetcode.code1558;

public class Solution {
	public int minOperations(int[] nums) {
		int add = 0, plus = 0;
		for (int num : nums) {
			int p = 0;
			while (num > 0) {
				if ((num & 1) == 1) {
					add++;
					num--;
				} else {
					p++;
					num /= 2;
				}
			}
			plus = Math.max(p, plus);
		}
		return add + plus;
	}
}
